import fetch from '@/utils/fetch'

export function getPic (pagelist) {
  return fetch({
    url: '/priFuncImg/page?pageNum='+pagelist.page+'&pageSize='+pagelist.pageSize,
    method: 'get'
  })
}

export function deletePic (id) {
  return fetch({
    url: '/priFuncImg/'+id+"?"+new Date().getTime(),
    method: 'delete'
  })
}

export function searchPic (pagelist) {
  return fetch({
    url: '/priFuncImg/page/filter?pageNum='+pagelist.pageNum+'&pageSize='+pagelist.pageSize+'&name='+pagelist.name,
    // url: '/priFuncImg/page/filter',
    
    method:'post',
    // data:pagelist,
  })
}

export function getAddPic () {
  return fetch({
    url: '/pic/defaultPic',
    method: 'get'
  })
}


export function editPic (result) {
  return fetch({
    // url: '/priFuncImg?id='+id+'&name='+name+'&updateUserId='+updateUserId+"&updateTime="+updateTime,
    url: '/priFuncImg?'+new Date().getTime(),
    method: 'put',
    data:result
  })
}


export function addPic(result){
  return fetch({
    url:'/priFuncImg',
    method:"post",
    data:result
    // header:{'content-type':"application/x-www-form-urlencoded;charset=UTF-8"},
  })
}